#ifndef ___________________WARD___UIELEMENT_H
#define ___________________WARD___UIELEMENT_H

/*

This is the base class for all UI Elements.  UI Elements are objects which can be manipulated by the user on the game
screen in order to set values, ect.

Examples are the slider bar, the checkbox, the radio box set, the textbox, ect.


*/

#include "driver.h"
#include "colorScheme.h"

class uielement
{

public:
	uielement();

	//callback functions for selecting the item, and then for determining whether to enable or disable it


	//this should typically mean pressing "enter" while this element is highlighted
	virtual void select() = 0;
	virtual void left() = 0;
	virtual void right() = 0;
	virtual bool clicked(int x, int y) = 0;
	virtual void onClick() = 0;


	void enable() { enabled = true; }
	void disable() { enabled = false; }



	//the object may have two draw states: enabled and disabled (for greyed out buttons or something)
	virtual void draw() = 0;
	virtual void drawAt(int x, int y) = 0;
	//checks the function pointer callbacks to see whether it should be enabled or disabled


	virtual float getData() = 0;
	virtual void setData(float f) = 0;

protected:
	
	bool enabled;

	//the data itself.  For slider bars and checkboxes, a float is adequate.  However, for a textbox we
	//will need to use a string and change some things up
	float data;

	//the position of the uielement
	int xpos, ypos;

	void writeText(GLfloat x,GLfloat y,GLfloat x_scale,GLfloat y_scale,GLfloat y_space,string text);

};




#endif